 package com.gmrz.uaf.protocol.v1.validaton;
 
 import com.gmrz.uaf.common.Constants;
 import com.gmrz.uaf.protocol.v1.processor.exception.UAFErrorCode;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
 
 public class OperationValidator
   implements Validator<Constants.Operation>
 {
   private static final Logger LOG = LogManager.getLogger(OperationValidator.class);
   private Constants.Operation expectedOp;
 
   public OperationValidator(Constants.Operation expectedOp)
   {
     this.expectedOp = expectedOp;
   }
 
   public void validate(Constants.Operation actualOp) throws HeaderValidationException
   {
     if ((actualOp == null) || (this.expectedOp.getID() != actualOp.getID())) {
       LOG.error("Expected Op[" + this.expectedOp + "] didn't match with actual Op[" + actualOp + "]");
       throw new HeaderValidationException(UAFErrorCode.PROTOCOL_HEADER_OP_TYPE_INVALID);
     }
   }
 }
